package com.wicket.okrbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.TaskService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.wicket.okrapp.integration.FwAppBatchClient;
import com.wicket.okrcomponent.integration.FwCompConfSchemeClient;
import com.wicket.okrcalc.integration.FwCalcStandardDataClient;
import com.wicket.okrapp.integration.FwAppTaskClient;
import com.wicket.okrapp.integration.FwAppCycleStageDataClient;
import com.wicket.okrapp.integration.FwAppTargetCycleClient;
import com.wicket.okrapp.integration.FwAppTaskGenClient;
import com.wicket.okrframework.integration.FwBaseDivineDataClient;
import com.wicket.okrapp.integration.dto.QueryPlanEvaBatchSetDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryPlanEvaBatchSetDetailReqDto;
import com.wicket.okrcomponent.integration.dto.QueryItemMatchResultToAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QueryItemMatchResultToAnswerDetailComReqDto;
//import com.wicket.okrcomponent.integration.dto.QueryStandardDataDetailComRespDto;
//import com.wicket.okrcomponent.integration.dto.QueryStandardDataDetailComReqDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskRespDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskReqDto;
import com.wicket.okrapp.integration.dto.RefreshCycleStageDataRespDto;
import com.wicket.okrapp.integration.dto.RefreshCycleStageDataReqDto;
import com.wicket.okrapp.integration.dto.UpdateEvaObjTargetCycleComRespDto;
import com.wicket.okrapp.integration.dto.UpdateEvaObjTargetCycleComReqDto;
import com.wicket.okrapp.integration.dto.QueryExecuteCycleStageDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryExecuteCycleStageDetailComReqDto;
import com.wicket.okrapp.integration.dto.AddReportTaskStaDataCalcComRespDto;
import com.wicket.okrapp.integration.dto.AddReportTaskStaDataCalcComReqDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskRespDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskReqDto;
import com.wicket.okrapp.integration.dto.CalculateTaskReportStandardDataComRespDto;
import com.wicket.okrapp.integration.dto.CalculateTaskReportStandardDataComReqDto;
import com.wicket.okrapp.integration.dto.RefreshReportTaskStaDataCalcComRespDto;
import com.wicket.okrapp.integration.dto.RefreshReportTaskStaDataCalcComReqDto;
import java.util.concurrent.Callable;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrbff.common.exception.BizException;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrapp.integration.dto.QueryReportingTaskListRespDto;
import com.wicket.okrapp.integration.dto.QueryReportingTaskListReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrapp.integration.dto.QueryTaskRelatedListRespDto;
import com.wicket.okrapp.integration.dto.QueryTaskRelatedListReqDto;
import com.wicket.okrcalc.integration.dto.QueryStandardDataListComRespDto;
import com.wicket.okrcalc.integration.dto.QueryStandardDataListComReqDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrcomponent.integration.dto.QueryClassMatchResultToAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QueryClassMatchResultToAnswerDetailComReqDto;
import com.wicket.okrapp.integration.dto.ApproveFailTaskReportedToMeRespDto;
import com.wicket.okrapp.integration.dto.ApproveFailTaskReportedToMeReqDto;
import com.wicket.okrapp.integration.FwAppEvaThemeClient;
import com.wicket.okrapp.integration.dto.QueryEvaFillRoleDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaFillRoleDetailReqDto;
import com.wicket.okrapp.integration.dto.QueryEvaFillMemberDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaFillMemberDetailReqDto;
import com.wicket.okrapp.integration.dto.CommitTaskReportStandardDataComRespDto;
import com.wicket.okrapp.integration.dto.CommitTaskReportStandardDataComReqDto;
import com.wicket.okrapp.integration.dto.CheckIsOpenEvaRespDto;
import com.wicket.okrapp.integration.dto.CheckIsOpenEvaReqDto;
import com.wicket.okrapp.integration.dto.QueryConfigOfReportingTaskCalcDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryConfigOfReportingTaskCalcDetailReqDto;
import com.wicket.okrcalc.integration.dto.QueryEvaObjTargetCycleDataDetailComRespDto;
import com.wicket.okrcalc.integration.dto.QueryEvaObjTargetCycleDataDetailComReqDto;
import com.wicket.okrapp.integration.dto.QueryEvaObjTargetCycleTargetDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaObjTargetCycleTargetDetailComReqDto;
import com.wicket.okrapp.integration.dto.GenerateTargetReportTasksComRespDto;
import com.wicket.okrapp.integration.dto.GenerateTargetReportTasksComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffReportingTaskDto;
import com.wicket.okrcomponent.integration.dto.QueryConfItemMatchAnswerDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryConfItemMatchAnswerDetailComReqDto;
import com.wicket.okrcomponent.integration.FwCompDivineDataClient;
import com.wicket.okrcomponent.integration.dto.QueryOutputParametersDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QueryOutputParametersDetailComReqDto;
import com.wicket.okrapp.integration.dto.CheckIsOpenEvaComRespDto;
import com.wicket.okrapp.integration.dto.CheckIsOpenEvaComReqDto;
import com.wicket.okrapp.integration.dto.QueryEvaObjTargetCycleDetailBorderRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaObjTargetCycleDetailBorderReqDto;
import com.wicket.okrapp.integration.FwAppEvaSystemClient;
import com.wicket.okrapp.integration.dto.JudgeEvaDataIsVisibleComRespDto;
import com.wicket.okrapp.integration.dto.JudgeEvaDataIsVisibleComReqDto;
import com.wicket.okrapp.integration.dto.CommitSingleTaskReportEvaInfoComRespDto;
import com.wicket.okrapp.integration.dto.CommitSingleTaskReportEvaInfoComReqDto;
import com.wicket.okrapp.integration.dto.QueryEvaFillRoleDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaFillRoleDetailComReqDto;
import com.wicket.okrcalc.integration.dto.QueryOrgOrMatchingStandardDataListComRespDto;
import com.wicket.okrcalc.integration.dto.QueryOrgOrMatchingStandardDataListComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffTaskerIsPartakeEvaDto;
import com.wicket.okrapp.integration.dto.ImplementReportingTaskCanBeSubmitComRespDto;
import com.wicket.okrapp.integration.dto.ImplementReportingTaskCanBeSubmitComReqDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskRelateComRespDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskRelateComReqDto;
import com.wicket.okrapp.integration.dto.ImplementReportTaskStaDataCalcComRespDto;
import com.wicket.okrapp.integration.dto.ImplementReportTaskStaDataCalcComReqDto;
import com.wicket.okrapp.integration.dto.JudgeTargetContentIsEvaComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTargetContentIsEvaComReqDto;
import com.wicket.okrapp.integration.dto.QueryCycleStageDataDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryCycleStageDataDetailComReqDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskComRespDto;
import com.wicket.okrapp.integration.dto.RefreshReportingTaskComReqDto;
import com.wicket.okrapp.integration.dto.CancelApprovedTaskReportComRespDto;
import com.wicket.okrapp.integration.dto.CancelApprovedTaskReportComReqDto;
import com.wicket.okrapp.integration.dto.JudgeAppraiserIsDoneTargetContentEvaComRespDto;
import com.wicket.okrapp.integration.dto.JudgeAppraiserIsDoneTargetContentEvaComReqDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportEvaAndCheckComRespDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportEvaAndCheckComReqDto;
import com.wicket.okrapp.integration.dto.RefreshCycleStageDataComRespDto;
import com.wicket.okrapp.integration.dto.RefreshCycleStageDataComReqDto;
import com.wicket.okrcomponent.integration.dto.QueryConfItemMatchEvaTempAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QueryConfItemMatchEvaTempAnswerDetailComReqDto;
import com.wicket.okrapp.integration.dto.CommitTaskReportProgressAndTargetDataComRespDto;
import com.wicket.okrapp.integration.dto.CommitTaskReportProgressAndTargetDataComReqDto;
import com.wicket.okrapp.integration.dto.ApproveSucceedTaskReportedToMeComRespDto;
import com.wicket.okrapp.integration.dto.ApproveSucceedTaskReportedToMeComReqDto;
import com.wicket.okrapp.integration.dto.ImplementReportingTaskElementComRespDto;
import com.wicket.okrapp.integration.dto.ImplementReportingTaskElementComReqDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskProcessingComRespDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskProcessingComReqDto;
import com.wicket.okrapp.integration.dto.JudgeTargetContentIsComEvaComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTargetContentIsComEvaComReqDto;
import com.wicket.okrapp.integration.dto.JudgeTaskReportRelRoleComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTaskReportRelRoleComReqDto;
import com.wicket.okrapp.integration.dto.ApproveReportingTaskRelateAndCalcComRespDto;
import com.wicket.okrapp.integration.dto.ApproveReportingTaskRelateAndCalcComReqDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskComRespDto;
import com.wicket.okrapp.integration.dto.CommitReportingTaskComReqDto;
import com.wicket.okrapp.integration.dto.BusAppDocRelaDto;
import com.wicket.okrapp.integration.dto.JudgeTaskAuditPowerAnalyseComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTaskAuditPowerAnalyseComReqDto;
import com.wicket.okrapp.integration.FwAppDivineDataClient;
import com.wicket.okrapp.integration.dto.ObtainReceiveFieldComRespDto;
import com.wicket.okrapp.integration.dto.ObtainReceiveFieldComReqDto;
import com.wicket.okrapp.integration.dto.ImplementTaskReportProgressAndTargetDataComRespDto;
import com.wicket.okrapp.integration.dto.ImplementTaskReportProgressAndTargetDataComReqDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportRelAndCheckComRespDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportRelAndCheckComReqDto;
import com.wicket.okrapp.integration.dto.QuerySubReportingTaskListComRespDto;
import com.wicket.okrapp.integration.dto.QuerySubReportingTaskListComReqDto;
import com.wicket.okrapp.integration.dto.QueryTaskPrincipalAndDeptListComRespDto;
import com.wicket.okrapp.integration.dto.QueryTaskPrincipalAndDeptListComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffSubReportingTaskDto;
import com.wicket.okrapp.integration.dto.TempStorageTaskReportPermissionVerificationComRespDto;
import com.wicket.okrapp.integration.dto.TempStorageTaskReportPermissionVerificationComReqDto;
import com.wicket.okrapp.integration.dto.ApproveSucceedTaskReportPermissionVerificationComRespDto;
import com.wicket.okrapp.integration.dto.ApproveSucceedTaskReportPermissionVerificationComReqDto;
import com.wicket.okrapp.integration.dto.JudgeTaskReportPermissionVerificationComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTaskReportPermissionVerificationComReqDto;
import com.wicket.okrapp.integration.dto.ImplementCompGenerationEvaObjectTaskComRespDto;
import com.wicket.okrapp.integration.dto.ImplementCompGenerationEvaObjectTaskComReqDto;
import com.wicket.okrapp.integration.dto.QueryPlanEvaBatchSetDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryPlanEvaBatchSetDetailComReqDto;
import com.wicket.okrapp.integration.FwAppVirtualOrgClient;
import com.wicket.okrapp.integration.dto.QueryListByTimeSliceContentVirtualOrgMemberComRespDto;
import com.wicket.okrapp.integration.dto.QueryListByTimeSliceContentVirtualOrgMemberComReqDto;
import com.wicket.okrapp.integration.FwAppConventionalSchedulingClient;
import com.wicket.okrapp.integration.dto.ImplementTaskOverdueEtcComRespDto;
import com.wicket.okrapp.integration.dto.ImplementTaskOverdueEtcComReqDto;
import com.wicket.okrapp.integration.dto.ImplementCanReportElementAnalysisComRespDto;
import com.wicket.okrapp.integration.dto.ImplementCanReportElementAnalysisComReqDto;
import com.wicket.okrapp.integration.dto.QueryToBeReportedTaskStandardDataDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryToBeReportedTaskStandardDataDetailComReqDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportTempAndSubmitComRespDto;
import com.wicket.okrapp.integration.dto.ImplementJudgeTaskReportTempAndSubmitComReqDto;
import com.wicket.okrapp.integration.dto.ImplementTempStorageReportTaskVerifyComRespDto;
import com.wicket.okrapp.integration.dto.ImplementTempStorageReportTaskVerifyComReqDto;
import com.wicket.okrapp.integration.dto.ImplementReportIncompleteContinueCreateTaskComRespDto;
import com.wicket.okrapp.integration.dto.ImplementReportIncompleteContinueCreateTaskComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffPicSingleSetDataEntryDto;
import com.wicket.okrapp.integration.dto.ImplementRemindToReportComRespDto;
import com.wicket.okrapp.integration.dto.ImplementRemindToReportComReqDto;
import com.wicket.okrapp.integration.dto.ImplementEvaluationRoleConvertComRespDto;
import com.wicket.okrapp.integration.dto.ImplementEvaluationRoleConvertComReqDto;
import com.wicket.okrcomponent.integration.dto.QuerySchemeMatchSingleResultToAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QuerySchemeMatchSingleResultToAnswerDetailComReqDto;
import com.wicket.okrfinance.integration.FwFinanceFinanceClient;
import com.wicket.okrcalc.integration.dto.ImplementCalcRightCycleActualValueComRespDto;
import com.wicket.okrcalc.integration.dto.ImplementCalcRightCycleActualValueComReqDto;
import com.wicket.okrfinance.integration.dto.QueryAccountSubjectListComRespDto;
import com.wicket.okrfinance.integration.dto.QueryAccountSubjectListComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffAccountSubjectDto;
import com.wicket.okrapp.integration.FwAppFinanceClient;
import com.wicket.okrapp.integration.dto.JudgeBudgetReportCanBeSubmitComRespDto;
import com.wicket.okrapp.integration.dto.JudgeBudgetReportCanBeSubmitComReqDto;
import com.wicket.okrapp.integration.dto.QueryUsableAccountSubjectListComRespDto;
import com.wicket.okrapp.integration.dto.QueryUsableAccountSubjectListComReqDto;
import com.wicket.okrcalc.integration.FwCalcWorkTasksClient;
import com.wicket.okrcalc.integration.dto.QueryToBeReportedWorkTaskStandardDataDetailComRespDto;
import com.wicket.okrcalc.integration.dto.QueryToBeReportedWorkTaskStandardDataDetailComReqDto;
import com.wicket.okrapp.integration.FwAppMessageClient;
import com.wicket.okrapp.integration.dto.BottomUpdateNumberContentStatusMessagesComRespDto;
import com.wicket.okrapp.integration.dto.BottomUpdateNumberContentStatusMessagesComReqDto;
import com.wicket.okrapp.integration.dto.JudgeTaskEvaIsDoneComRespDto;
import com.wicket.okrapp.integration.dto.JudgeTaskEvaIsDoneComReqDto;
import com.wicket.okrcalc.integration.dto.QueryStandardDataDetailComRespDto;
import com.wicket.okrcalc.integration.dto.QueryStandardDataDetailComReqDto;
import com.wicket.okrapp.integration.dto.QueryVirtualOrgMemberDetailRespDto;
import com.wicket.okrapp.integration.dto.QueryVirtualOrgMemberDetailReqDto;
import com.wicket.okrapp.integration.dto.QueryEvaTempDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryEvaTempDetailComReqDto;
import com.wicket.okrcalc.integration.FwCalcTaskClient;
import com.wicket.okrapp.integration.dto.QueryConfigOfReportingTaskCalcDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryConfigOfReportingTaskCalcDetailComReqDto;
import com.wicket.okrapp.integration.dto.CommitToBeReportedProAndActAndBudDataComRespDto;
import com.wicket.okrapp.integration.dto.CommitToBeReportedProAndActAndBudDataComReqDto;
import com.wicket.okrcalc.integration.FwCalcTargetCalcClient;
import com.wicket.okrapp.integration.dto.CommitToBeReportedTaskStdDataComRespDto;
import com.wicket.okrapp.integration.dto.CommitToBeReportedTaskStdDataComReqDto;
import com.wicket.okrcalc.integration.dto.CommitEvaStandardDataComRespDto;
import com.wicket.okrcalc.integration.dto.CommitEvaStandardDataComReqDto;
import com.wicket.okrapp.integration.FwAppTargetCalcClient;
import com.wicket.okrapp.integration.dto.AnalysisParentSubMidCycleTypeTakeDownComRespDto;
import com.wicket.okrapp.integration.dto.AnalysisParentSubMidCycleTypeTakeDownComReqDto;
import com.wicket.okrapp.integration.dto.DocumentDto;
import com.wicket.okrapp.integration.dto.CycleStageDataAttDocDto;
import com.wicket.okrapp.integration.dto.JudgeCurReporterIsPersonLiableComRespDto;
import com.wicket.okrapp.integration.dto.JudgeCurReporterIsPersonLiableComReqDto;
import com.wicket.okrapp.integration.dto.ImplementSetReportTaskProblemDataStatusComRespDto;
import com.wicket.okrapp.integration.dto.ImplementSetReportTaskProblemDataStatusComReqDto;
import com.wicket.okrapp.integration.dto.QueryNotReleaseTaskInfoDetailComRespDto;
import com.wicket.okrapp.integration.dto.QueryNotReleaseTaskInfoDetailComReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffBusAppDocRelaDto;
import com.wicket.okrapp.integration.dto.QueryReportTaskListComRespDto;
import com.wicket.okrapp.integration.dto.QueryReportTaskListComReqDto;
import com.wicket.okrapp.integration.FwAppGridCalculateClient;
import com.wicket.okrapp.integration.dto.ImplementComRespDto;
import com.wicket.okrapp.integration.dto.ImplementComReqDto;
import com.wicket.okrapp.integration.dto.AnalysisUnReportSencePowerComRespDto;
import com.wicket.okrapp.integration.dto.AnalysisUnReportSencePowerComReqDto;
import com.wicket.okrcomponent.integration.FwCompInterfaceModeClient;
import com.wicket.okrcomponent.integration.FwCompTemplateEngineClient;
import com.wicket.okrapp.integration.dto.QueryReportTaskExportDetailsListComRespDto;
import com.wicket.okrapp.integration.dto.QueryReportTaskExportDetailsListComReqDto;
import com.wicket.okrcomponent.integration.dto.ImplementTimeTurnToStringComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementTimeTurnToStringComReqDto;
import com.wicket.okrcomponent.integration.dto.GenerateSemanticInstanceStoryComRespDto;
import com.wicket.okrcomponent.integration.dto.GenerateSemanticInstanceStoryComReqDto;
import com.wicket.okrcomponent.integration.dto.QueryConfItemMatchAnswerListComRespDto;
import com.wicket.okrapp.integration.dto.QueryConfItemMatchAnswerListComReqDto;
import com.wicket.okrcomponent.integration.dto.ImplementExportDatatoExcelComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementExportDatatoExcelComReqDto;
import com.wicket.okrcomponent.integration.dto.ExcelHeaderFieldDataDto;
import com.wicket.okrcomponent.integration.dto.ExportDataDto;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;


/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Task", tags = { "Task" })
@RestController
// @RequestMapping("/oms/task/")
public class TaskController {

  @Autowired
  TaskService taskService;

/**
   * B3-查询汇报给我的任务列表
   * gen by moon at 12/18/2022, 9:03:24 PM
   */
    @PostMapping("/oms/task/queryTaskReportedToMeList")
    @ApiOperation(value = "B3-查询汇报给我的任务列表", response = OkrResult.class)
    public OkrResult<BffQueryTaskReportedToMeListRespDto> queryTaskReportedToMeList(@RequestBody(required=false) @Validated BffQueryTaskReportedToMeListReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskReportedToMeList(reqDTO));
    }
/**
   * B3-查询我相关的任务列表
   * gen by moon at 12/19/2022, 5:34:41 AM
   */
    @PostMapping("/oms/task/queryTaskRelatedList")
    @ApiOperation(value = "B3-查询我相关的任务列表", response = OkrResult.class)
    public OkrResult<BffQueryTaskRelatedListRespDto> queryTaskRelatedList(@RequestBody(required=false) @Validated BffQueryTaskRelatedListReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskRelatedList(reqDTO));
    }
/**
   * B3-暂存我汇报的任务
   * gen by moon at 12/20/2022, 2:47:41 AM
   */
    @PostMapping("/oms/task/tempStorageTaskReport")
    @ApiOperation(value = "B3-暂存我汇报的任务", response = OkrResult.class)
    public OkrResult<BffTempStorageTaskReportRespDto> tempStorageTaskReport(@RequestBody(required=false) @Validated BffTempStorageTaskReportReqDto reqDTO){
        return OkrResult.success(taskService.tempStorageTaskReport(reqDTO));
    }
/**
   * B3-查询任务评价信息列表
   * gen by moon at 12/17/2022, 5:51:29 AM
   */
    @PostMapping("/oms/task/queryTaskEvaInfoList")
    @ApiOperation(value = "B3-查询任务评价信息列表", response = OkrResult.class)
    public OkrResult<BffQueryTaskEvaInfoListRespDto> queryTaskEvaInfoList(@RequestBody(required=false) @Validated BffQueryTaskEvaInfoListReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskEvaInfoList(reqDTO));
    }
/**
   * B3-查询我汇报的任务评价信息详情
   * gen by moon at 11/15/2022, 9:46:42 PM
   */
    @PostMapping("/oms/task/queryTaskReportEvaInfoDetail")
    @ApiOperation(value = "B3-查询我汇报的任务评价信息详情", response = OkrResult.class)
    public OkrResult<BffQueryTaskReportEvaInfoDetailRespDto> queryTaskReportEvaInfoDetail(@RequestBody(required=false) @Validated BffQueryTaskReportEvaInfoDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskReportEvaInfoDetail(reqDTO));
    }
/**
   * B3-查汇报给我的任务评价信息详情
   * gen by moon at 11/17/2022, 5:45:14 PM
   */
    @PostMapping("/oms/task/queryTaskReportedToMeEvaInfoDetail")
    @ApiOperation(value = "B3-查汇报给我的任务评价信息详情", response = OkrResult.class)
    public OkrResult<BffQueryTaskReportedToMeEvaInfoDetailRespDto> queryTaskReportedToMeEvaInfoDetail(@RequestBody(required=false) @Validated BffQueryTaskReportedToMeEvaInfoDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskReportedToMeEvaInfoDetail(reqDTO));
    }
/**
   * B3-查询我汇报的任务列表
   * gen by moon at 12/18/2022, 9:03:28 PM
   */
    @PostMapping("/oms/task/queryTaskReportList")
    @ApiOperation(value = "B3-查询我汇报的任务列表", response = OkrResult.class)
    public OkrResult<BffQueryTaskReportListRespDto> queryTaskReportList(@RequestBody(required=false) @Validated BffQueryTaskReportListReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskReportList(reqDTO));
    }
/**
   * B3-撤销汇报我汇报的任务
   * gen by moon at 9/24/2022, 4:16:12 AM
   */
    @PostMapping("/oms/task/cancelApprovedTaskReport")
    @ApiOperation(value = "B3-撤销汇报我汇报的任务", response = OkrResult.class)
    public OkrResult<BffCancelApprovedTaskReportRespDto> cancelApprovedTaskReport(@RequestBody(required=false) @Validated BffCancelApprovedTaskReportReqDto reqDTO){
        return OkrResult.success(taskService.cancelApprovedTaskReport(reqDTO));
    }
/**
   * B3-审核通过汇报给我的任务
   * gen by moon at 1/13/2023, 5:55:33 AM
   */
    @PostMapping("/oms/task/approveSucceedTaskReportedToMe")
    @ApiOperation(value = "B3-审核通过汇报给我的任务", response = OkrResult.class)
    public OkrResult<BffApproveSucceedTaskReportedToMeRespDto> approveSucceedTaskReportedToMe(@RequestBody(required=false) @Validated BffApproveSucceedTaskReportedToMeReqDto reqDTO){
        return OkrResult.success(taskService.approveSucceedTaskReportedToMe(reqDTO));
    }
/**
   * B3-审核失败汇报给我的任务
   * gen by moon at 12/17/2022, 9:07:41 PM
   */
    @PostMapping("/oms/task/approveFailTaskReportedToMe")
    @ApiOperation(value = "B3-审核失败汇报给我的任务", response = OkrResult.class)
    public OkrResult<BffApproveFailTaskReportedToMeRespDto> approveFailTaskReportedToMe(@RequestBody(required=false) @Validated BffApproveFailTaskReportedToMeReqDto reqDTO){
        return OkrResult.success(taskService.approveFailTaskReportedToMe(reqDTO));
    }

/**
   * B3-查询评价模板下汇报相关配置详情
   * gen by moon at 1/10/2023, 4:17:42 AM
   */
    @PostMapping("/oms/task/queryConfigOfReportingTaskDetail")
    @ApiOperation(value = "B3-查询评价模板下汇报相关配置详情", response = OkrResult.class)
    public OkrResult<BffQueryConfigOfReportingTaskDetailRespDto> queryConfigOfReportingTaskDetail(@RequestBody(required=false) @Validated BffQueryConfigOfReportingTaskDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryConfigOfReportingTaskDetail(reqDTO));
    }
/**
   * B3-查询我汇报的任务标准数据详情
   * gen by moon at 1/4/2023, 8:57:45 PM
   */
    @PostMapping("/oms/task/queryTaskReportStandardDataDetail")
    @ApiOperation(value = "B3-查询我汇报的任务标准数据详情", response = OkrResult.class)
    public OkrResult<BffQueryTaskReportStandardDataDetailRespDto> queryTaskReportStandardDataDetail(@RequestBody(required=false) @Validated BffQueryTaskReportStandardDataDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryTaskReportStandardDataDetail(reqDTO));
    }
/**
   * B3-生成目标内容汇报任务（人工真实测试）
   * gen by moon at 9/22/2022, 1:09:06 AM
   */
    @PostMapping("/oms/task/addTargetReportTasks")
    @ApiOperation(value = "B3-生成目标内容汇报任务（人工真实测试）", response = OkrResult.class)
    public OkrResult<BffAddTargetReportTasksRespDto> addTargetReportTasks(@RequestBody(required=false) @Validated BffAddTargetReportTasksReqDto reqDTO){
        return OkrResult.success(taskService.addTargetReportTasks(reqDTO));
    }
/**
   * B3-计算汇报任务的标准数据（人工真实测试）
   * gen by moon at 9/28/2022, 7:15:21 AM
   */
    @PostMapping("/oms/task/calculateTaskReportStandardData")
    @ApiOperation(value = "B3-计算汇报任务的标准数据（人工真实测试）", response = OkrResult.class)
    public OkrResult<BffCalculateTaskReportStandardDataRespDto> calculateTaskReportStandardData(@RequestBody(required=false) @Validated BffCalculateTaskReportStandardDataReqDto reqDTO){
        return OkrResult.success(taskService.calculateTaskReportStandardData(reqDTO));
    }
/**
   * B3-提交我汇报的任务进度值和目标值
   * gen by moon at 1/11/2023, 5:53:01 AM
   */
    @PostMapping("/oms/task/commitTaskReportProgressAndTargetData")
    @ApiOperation(value = "B3-提交我汇报的任务进度值和目标值", response = OkrResult.class)
    public OkrResult<BffCommitTaskReportProgressAndTargetDataRespDto> commitTaskReportProgressAndTargetData(@RequestBody(required=false) @Validated BffCommitTaskReportProgressAndTargetDataReqDto reqDTO){
        return OkrResult.success(taskService.commitTaskReportProgressAndTargetData(reqDTO));
    }
/**
   * B3-查询单条汇报任务评价信息详情
   * gen by moon at 12/29/2022, 9:53:08 PM
   */
    @PostMapping("/oms/task/querySingleTaskReportEvaInfoDetail")
    @ApiOperation(value = "B3-查询单条汇报任务评价信息详情", response = OkrResult.class)
    public OkrResult<BffQuerySingleTaskReportEvaInfoDetailRespDto> querySingleTaskReportEvaInfoDetail(@RequestBody(required=false) @Validated BffQuerySingleTaskReportEvaInfoDetailReqDto reqDTO){
        return OkrResult.success(taskService.querySingleTaskReportEvaInfoDetail(reqDTO));
    }
/**
   * B3-提交单条汇报任务评价信息
   * gen by moon at 12/16/2022, 9:12:26 PM
   */
    @PostMapping("/oms/task/commitSingleTaskReportEvaInfo")
    @ApiOperation(value = "B3-提交单条汇报任务评价信息", response = OkrResult.class)
    public OkrResult<BffCommitSingleTaskReportEvaInfoRespDto> commitSingleTaskReportEvaInfo(@RequestBody(required=false) @Validated BffCommitSingleTaskReportEvaInfoReqDto reqDTO){
        return OkrResult.success(taskService.commitSingleTaskReportEvaInfo(reqDTO));
    }
/**
   * B3-执行汇报任务评价审核元素判断
   * gen by moon at 12/20/2022, 2:47:48 AM
   */
    @PostMapping("/oms/task/implementJudgeTaskReportEvaAndCheck")
    @ApiOperation(value = "B3-执行汇报任务评价审核元素判断", response = OkrResult.class)
    public OkrResult<BffImplementJudgeTaskReportEvaAndCheckRespDto> implementJudgeTaskReportEvaAndCheck(@RequestBody(required=false) @Validated BffImplementJudgeTaskReportEvaAndCheckReqDto reqDTO){
        return OkrResult.success(taskService.implementJudgeTaskReportEvaAndCheck(reqDTO));
    }
/**
   * B3-查询下级汇报任务列表
   * gen by moon at 3/30/2023, 7:17:18 PM
   */
    @PostMapping("/oms/task/querySubReportingTaskList")
    @ApiOperation(value = "B3-查询下级汇报任务列表", response = OkrResult.class)
    public OkrResult<BffQuerySubReportingTaskListRespDto> querySubReportingTaskList(@RequestBody(required=false) @Validated BffQuerySubReportingTaskListReqDto reqDTO){
        return OkrResult.success(taskService.querySubReportingTaskList(reqDTO));
    }
/**
   * B3-执行补偿生成全网的汇报任务
   * gen by moon at 5/12/2023, 7:21:43 PM
   */
    @PostMapping("/oms/task/implementCompGenerationEvaObjectTask")
    @ApiOperation(value = "B3-执行补偿生成全网的汇报任务", response = OkrResult.class)
    public OkrResult<BffImplementCompGenerationEvaObjectTaskRespDto> implementCompGenerationEvaObjectTask(@RequestBody(required=false) @Validated BffImplementCompGenerationEvaObjectTaskReqDto reqDTO){
        return OkrResult.success(taskService.implementCompGenerationEvaObjectTask(reqDTO));
    }
/**
   * B3-执行继续汇报元素分析
   * gen by moon at 9/27/2023, 11:07:09 PM
   */
    @PostMapping("/oms/task/implementCanReportElementAnalysis")
    @ApiOperation(value = "B3-执行继续汇报元素分析", response = OkrResult.class)
    public OkrResult<BffImplementCanReportElementAnalysisRespDto> implementCanReportElementAnalysis(@RequestBody(required=false) @Validated BffImplementCanReportElementAnalysisReqDto reqDTO){
        return OkrResult.success(taskService.implementCanReportElementAnalysis(reqDTO));
    }
/**
   * B3-查询待汇报任务标准数据详情
   * gen by moon at 9/28/2023, 3:11:06 PM
   */
    @PostMapping("/oms/task/queryToBeReportedTaskStandardDataDetail")
    @ApiOperation(value = "B3-查询待汇报任务标准数据详情", response = OkrResult.class)
    public OkrResult<BffQueryToBeReportedTaskStandardDataDetailRespDto> queryToBeReportedTaskStandardDataDetail(@RequestBody(required=false) @Validated BffQueryToBeReportedTaskStandardDataDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryToBeReportedTaskStandardDataDetail(reqDTO));
    }
/**
   * B3-待汇报任务提交标准数据元素分析
   * gen by moon at 9/28/2023, 3:11:14 PM
   */
    @PostMapping("/oms/task/implementReportTaskSubmitDataAnalyse")
    @ApiOperation(value = "B3-待汇报任务提交标准数据元素分析", response = OkrResult.class)
    public OkrResult<BffImplementReportTaskSubmitDataAnalyseRespDto> implementReportTaskSubmitDataAnalyse(@RequestBody(required=false) @Validated BffImplementReportTaskSubmitDataAnalyseReqDto reqDTO){
        return OkrResult.success(taskService.implementReportTaskSubmitDataAnalyse(reqDTO));
    }
/**
   * B3-执行汇报任务暂存及提交元素分析
   * gen by moon at 10/1/2023, 12:52:59 AM
   */
    @PostMapping("/oms/task/implementJudgeTaskReportTempAndSubmit")
    @ApiOperation(value = "B3-执行汇报任务暂存及提交元素分析", response = OkrResult.class)
    public OkrResult<BffImplementJudgeTaskReportTempAndSubmitRespDto> implementJudgeTaskReportTempAndSubmit(@RequestBody(required=false) @Validated BffImplementJudgeTaskReportTempAndSubmitReqDto reqDTO){
        return OkrResult.success(taskService.implementJudgeTaskReportTempAndSubmit(reqDTO));
    }
/**
   * B3-执行提醒下级去汇报
   * gen by moon at 10/22/2023, 7:32:40 PM
   */
    @PostMapping("/oms/task/implementRemindToReport")
    @ApiOperation(value = "B3-执行提醒下级去汇报", response = OkrResult.class)
    public OkrResult<BffImplementRemindToReportRespDto> implementRemindToReport(@RequestBody(required=false) @Validated BffImplementRemindToReportReqDto reqDTO){
        return OkrResult.success(taskService.implementRemindToReport(reqDTO));
    }
/**
   * B3提交待汇报进度值、实际值及预算标准数据
   * gen by moon at 3/16/2024, 3:15:20 AM
   */
    @PostMapping("/oms/task/commitToBeReportedProAndActAndBudData")
    @ApiOperation(value = "B3提交待汇报进度值、实际值及预算标准数据", response = OkrResult.class)
    public OkrResult<BffCommitToBeReportedProAndActAndBudDataRespDto> commitToBeReportedProAndActAndBudData(@RequestBody(required=false) @Validated BffCommitToBeReportedProAndActAndBudDataReqDto reqDTO){
        return OkrResult.success(taskService.commitToBeReportedProAndActAndBudData(reqDTO));
    }
/**
   * B4提交评价标准数据
   * gen by moon at 4/25/2024, 2:24:26 AM
   */
    @PostMapping("/oms/task/commitEvaStandardData")
    @ApiOperation(value = "B4提交评价标准数据", response = OkrResult.class)
    public OkrResult<BffCommitEvaStandardDataRespDto> commitEvaStandardData(@RequestBody(required=false) @Validated BffCommitEvaStandardDataReqDto reqDTO){
        return OkrResult.success(taskService.commitEvaStandardData(reqDTO));
    }
/**
   * B3设汇报任务问题数据状态
   * gen by moon at 7/13/2024, 1:13:28 AM
   */
    @PostMapping("/oms/task/implementSetReportTaskProblemDataStatus")
    @ApiOperation(value = "B3设汇报任务问题数据状态", response = OkrResult.class)
    public OkrResult<BffImplementSetReportTaskProblemDataStatusRespDto> implementSetReportTaskProblemDataStatus(@RequestBody(required=false) @Validated BffImplementSetReportTaskProblemDataStatusReqDto reqDTO){
        return OkrResult.success(taskService.implementSetReportTaskProblemDataStatus(reqDTO));
    }
/**
   * B3查询未发布的汇报资料详情
   * gen by moon at 7/19/2024, 5:46:33 PM
   */
    @PostMapping("/oms/task/queryNotReleaseTaskInfoDetail")
    @ApiOperation(value = "B3查询未发布的汇报资料详情", response = OkrResult.class)
    public OkrResult<BffQueryNotReleaseTaskInfoDetailRespDto> queryNotReleaseTaskInfoDetail(@RequestBody(required=false) @Validated BffQueryNotReleaseTaskInfoDetailReqDto reqDTO){
        return OkrResult.success(taskService.queryNotReleaseTaskInfoDetail(reqDTO));
    }
/**
   * B3查询新汇报任务列表
   * gen by moon at 9/4/2024, 8:41:53 PM
   */
    @PostMapping("/oms/task/queryReportTaskList")
    @ApiOperation(value = "B3查询新汇报任务列表", response = OkrResult.class)
    public OkrResult<BffQueryReportTaskListRespDto> queryReportTaskList(@RequestBody(required=false) @Validated BffQueryReportTaskListReqDto reqDTO){
        return OkrResult.success(taskService.queryReportTaskList(reqDTO));
    }

    private String convertCode(String enCode){
        if(enCode.equals("EDITING")){
            return "草稿";
        }else if(enCode.equals("TOBESIGN")){
            return "草稿";
        }else if(enCode.equals("ONGOING")){
            return "草稿";
        }else if(enCode.equals("FAILED")){
            return "草稿";
        }else if(enCode.equals("OVERDUE")){
            return "草稿";
        }else if(enCode.equals("NOT_AT_THE")){
            return "草稿";
        }else if(enCode.equals("UNCOMPLETED")){
            return "草稿";
        }else if(enCode.equals("COMPLETED")){
            return "草稿";
        }else if(enCode.equals("EVA")){
            return "草稿";
        }else if(enCode.equals("AUDIT")){
            return "草稿";
        }else if(enCode.equals("SUCCESS")){
            return "已成功";
        }else if(enCode.equals("EXPIRED")){
            return "已逾期";
        }else if(enCode.equals("UNREPORTED")){
            return "待汇报";
        }else if(enCode.equals("UNLIMITED")){
            return "不限";
        }else if(enCode.equals("ENDED")){
            return "已结束";
        }
        return "未知";
    }
/**
   * B3执行导出汇报任务明细
   * gen by moon at 12/31/2024, 5:35:00 PM
   */
    @PostMapping("/oms/task/implementReportTaskExportDetails")
    @ApiOperation(value = "B3执行导出汇报任务明细", response = OkrResult.class)
    public void implementReportTaskExportDetails(@RequestBody(required=false) @Validated BffImplementReportTaskExportDetailsReqDto reqDTO, HttpServletResponse response){
        taskService.implementReportTaskExportDetails(reqDTO,(excelData)->{
            if(excelData.containsKey("exportFileFormat")){
                String exportFileFormat = (String)excelData.get("exportFileFormat");
                String exportExcelFileName = (String)excelData.get("exportExcelFileName");
                List<ExcelHeaderFieldDataDto> headerDataList = (List<ExcelHeaderFieldDataDto>)excelData.get("excelHeaderFieldDataList");
                List<ExportDataDto> dataList = (List<ExportDataDto>)excelData.get("exportDataList");

                String fileFullNameTmp = exportExcelFileName + "." +exportFileFormat;
                String fileFullName = null;
                try {
                    fileFullName = URLEncoder.encode(fileFullNameTmp, "UTF-8").replaceAll("\\+", "%20");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + fileFullName);
                response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                Workbook workbook = null;
                try {
                    workbook = new XSSFWorkbook();
                } catch (Exception e) {
                    e.printStackTrace();
                }


                // 创建一个工作表sheet
                Sheet sheet = workbook.createSheet("Sheet1");

                // 创建表头行
                Row headerRow = sheet.createRow(0);
                int column = 0;
                Cell numCell = headerRow.createCell(column++);
                numCell.setCellValue("编号");
                for (ExcelHeaderFieldDataDto field : headerDataList) {
                    Cell cell = headerRow.createCell(column++);
                    cell.setCellValue(field.getExcelHeaderCnFields());
                }

                // 填充数据
                long rowCount = 1l;
                for (int i = 0; i < dataList.size(); i++) {
                    Row row = sheet.createRow(i + 1);
                    ExportDataDto rowData = dataList.get(i);
                    for (int j = 0; j < 11; j++) {
                        Cell cell = row.createCell(j);
                        if(j==0){
                            cell.setCellValue(rowCount);
                        }else if(j==1 && rowData.getExportDataFields1()!=null){
                            cell.setCellValue(rowData.getExportDataFields1());
                        }else if(j==2 && rowData.getExportDataFields2()!=null){
                            cell.setCellValue(rowData.getExportDataFields2());
                        }else if(j==3 && rowData.getExportDataFields3()!=null){
                            cell.setCellValue(rowData.getExportDataFields3());
                        }else if(j==4 && rowData.getExportDataFields4()!=null){
                            cell.setCellValue(convertCode(rowData.getExportDataFields4()));
                        }else if(j==5 && rowData.getExportDataFields5()!=null){
                            cell.setCellValue(rowData.getExportDataFields5());
                        }else if(j==6 && rowData.getExportDataFields6()!=null){
                            cell.setCellValue(rowData.getExportDataFields6());
                        }else if(j==7 && rowData.getExportDataFields7()!=null){
                            cell.setCellValue(rowData.getExportDataFields7());
                        }else if(j==8 && rowData.getExportDataFields8()!=null){
                            cell.setCellValue(rowData.getExportDataFields8());
                        }else if(j==9 && rowData.getExportDataFields9()!=null){
                            cell.setCellValue(rowData.getExportDataFields9());
                        }else if(j==10 && rowData.getExportDataFields10()!=null){
                            cell.setCellValue(rowData.getExportDataFields10());
                        }
                    }
                    rowCount++;
                }

                // 自动调整列宽
                for (int i = 0; i < headerDataList.size(); i++) {
                    sheet.autoSizeColumn(i);
                }

                // 将工作簿写入文件
                try {
                    ServletOutputStream outputStream = response.getOutputStream();
                    workbook.write(outputStream);
                    workbook.close();
                    outputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                    try {
                        workbook.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }

        });
        return ;
    }


    /**
     * B3执行导出汇报任务明细
     * gen by moon at 12/31/2024, 5:35:00 PM
     */
    @GetMapping("/oms/task/implementReportTaskExportDetailsGet")
    @ApiOperation(value = "B3执行导出汇报任务明细", response = OkrResult.class)
    public void implementReportTaskExportDetailsGet(@RequestParam("cycleId") String cycleId,
                                                    @RequestParam("parentSubMidCycleType") String parentSubMidCycleType,
                                                    @RequestParam("evaluationTemplateId") String evaluationTemplateId,
                                                    HttpServletResponse response){
        BffImplementReportTaskExportDetailsReqDto reqDTO = new BffImplementReportTaskExportDetailsReqDto();
        reqDTO.setCycleId(cycleId);
        reqDTO.setParentSubMidCycleType(parentSubMidCycleType);
        reqDTO.setEvaluationTemplateId(evaluationTemplateId);
        taskService.implementReportTaskExportDetails(reqDTO,(excelData)->{
            if(excelData.containsKey("exportFileFormat")){
                String exportFileFormat = (String)excelData.get("exportFileFormat");
                String exportExcelFileName = (String)excelData.get("exportExcelFileName");
                List<ExcelHeaderFieldDataDto> headerDataList = (List<ExcelHeaderFieldDataDto>)excelData.get("excelHeaderFieldDataList");
                List<ExportDataDto> dataList = (List<ExportDataDto>)excelData.get("exportDataList");

                String fileFullNameTmp = exportExcelFileName + "." +exportFileFormat;
                String fileFullName = null;
                try {
                    fileFullName = URLEncoder.encode(fileFullNameTmp, "UTF-8").replaceAll("\\+", "%20");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + fileFullName);
                response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
                Workbook workbook = null;
                try {
                    workbook = new XSSFWorkbook();
                } catch (Exception e) {
                    e.printStackTrace();
                }


                // 创建一个工作表sheet
                Sheet sheet = workbook.createSheet("Sheet1");

                // 创建表头行
                Row headerRow = sheet.createRow(0);
                int column = 0;
                Cell numCell = headerRow.createCell(column++);
                numCell.setCellValue("编号");
                for (ExcelHeaderFieldDataDto field : headerDataList) {
                    Cell cell = headerRow.createCell(column++);
                    cell.setCellValue(field.getExcelHeaderCnFields());
                }

                // 填充数据
                long rowCount = 1l;
                for (int i = 0; i < dataList.size(); i++) {
                    Row row = sheet.createRow(i + 1);
                    ExportDataDto rowData = dataList.get(i);
                    for (int j = 0; j < 11; j++) {
                        Cell cell = row.createCell(j);
                        if(j==0){
                            cell.setCellValue(rowCount);
                        }else if(j==1 && rowData.getExportDataFields1()!=null){
                            cell.setCellValue(rowData.getExportDataFields1());
                        }else if(j==2 && rowData.getExportDataFields2()!=null){
                            cell.setCellValue(rowData.getExportDataFields2());
                        }else if(j==3 && rowData.getExportDataFields3()!=null){
                            cell.setCellValue(rowData.getExportDataFields3());
                        }else if(j==4 && rowData.getExportDataFields4()!=null){
                            cell.setCellValue(convertCode(rowData.getExportDataFields4()));
                        }else if(j==5 && rowData.getExportDataFields5()!=null){
                            cell.setCellValue(rowData.getExportDataFields5());
                        }else if(j==6 && rowData.getExportDataFields6()!=null){
                            cell.setCellValue(rowData.getExportDataFields6());
                        }else if(j==7 && rowData.getExportDataFields7()!=null){
                            cell.setCellValue(rowData.getExportDataFields7());
                        }else if(j==8 && rowData.getExportDataFields8()!=null){
                            cell.setCellValue(rowData.getExportDataFields8());
                        }else if(j==9 && rowData.getExportDataFields9()!=null){
                            cell.setCellValue(rowData.getExportDataFields9());
                        }else if(j==10 && rowData.getExportDataFields10()!=null){
                            cell.setCellValue(rowData.getExportDataFields10());
                        }
                    }
                    rowCount++;
                }

                // 自动调整列宽
                for (int i = 0; i < headerDataList.size(); i++) {
                    sheet.autoSizeColumn(i);
                }

                // 将工作簿写入文件
                try {
                    ServletOutputStream outputStream = response.getOutputStream();
                    workbook.write(outputStream);
                    workbook.close();
                    outputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                    try {
                        workbook.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }

        });
        return ;
    }
}
